﻿@using xiushen.Domain
@using xiushen.Infrastructure
@model xiushen.Models.BookViewModel
<div class="well">
    <ul class="nav nav-tabs" id="cataegoryList">
        @foreach (var data in Model.RootCategories)
        {
            <li><a href="#@data.ID" data-toggle="tab">@data.Name</a></li>
        }
    </ul>
    <div class="tab-content">
        @foreach (var data in Model.RootCategories)
        {
            <text>
                <div class="tab-pane" id="@data.ID">
                    <ul>
                        @{
                            Category data1 = data;
                            var datas = Model.AllCategorys.Where(r => r.ParentID == data1.ID);
                            foreach (var sub in datas)
                            {
                                <li><a href="@Url.Action("Books", new { id = sub.ID })" class="pull-left " style="padding-left: 5px;">@sub.Name</a></li>
                        
                            }
                        }
                    </ul>
                </div>
            </text>
        }
    </div>
</div>


@section scripts
{
    <script type="text/javascript">
        $(document).ready(function () {
            $('#cataegoryList a').mouseover(function(e) {
                e.preventDefault();
                $(this).tab('show');
            });
           
        });
    </script>
}
